#!/usr/bin/ruby -w
# -*- coding: UTF-8 -*-

=begin 
@author = sirius
@time = 2017.11.12
=end

# gets语句
puts "Enter a value :"
val = gets
puts val

str="Hello Ruby!"
putc str

print "Hello World"
print "Good Morning"

# 读取和写入文件
aFile = File.new("./file/input.txt", "w+")
if aFile
   aFile.syswrite("ABCDEF")
else
   puts "Unable to open file!"
end
aFile = File.new("./file/input.txt", "r+")
if aFile
   content = aFile.sysread(20)
   puts content
else
   puts "Unable to open file!"
end